const Router = require('koa-router');

let router = new Router();

router.get('/account_catalog',async ctx=>{
    ctx.body=[
        {txt:'娱乐',id:1},
        {txt:'生活',id:2},
        {txt:'爱情',id:3},
        {txt:'娱乐',id:4}
    ];
})

router.get('/get_province',async ctx=>{
    ctx.body = await ctx.db.query('SELECT * FROM provinces');
})

router.get('/get_city/:proid',async ctx=>{
    let {proid} = ctx.params;
    ctx.body = await ctx.db.query('SELECT * FROM cities WHERE provinceid=?',proid);
})


module.exports = router.routes();